Jump To:
Technical Q&As
Cocoa is an object-oriented application environment designed specifically for developing Mac OS X native applications. The Cocoa frameworks support rapid development and high productivity, and include a full-featured set of classes designed to create robust and powerful Mac OS X applications. Cocoa provides developers starting new Mac OS X projects the fastest way to full-featured, extensible, and maintainable implementations. Applications from UNIX and other platforms can also be brought to Mac OS X quickly by using Cocoa to build state-of-the-art Aqua user interfaces while retaining most existing core code.

Cocoa Resources
A guided introduction and learning path for developers new to Cocoa.   Essential information for developers using Objective-C and Java.   Objective-C and Java programming specifications, organized by framework.
Document Descriptions
On Off
Display

Sort by
Title
Sorted by
Topic
Sort by
Date
Calling an AppleScript and providing parameters from an Application (HTML) ()
QA1111: Explains calling and providing parameter values to an AppleScript event handler from an application written in C.
AppleScript 2002-03-13
BOM characters in 'utxt' clipboard flavor (HTML) ()
QA1221: Explains the use of the BOM character in 'utxt' scrap data
Data Management 2003-01-20
CFXML to CFPropertyListRef (and back!) (HTML) ()
QA1208: Describes to how save and restore a CFPropertyListRef to and from an XML file.
Data Management 2003-08-29
Setting environment variables for user processes (HTML)
QA1067: Tells how to set environment variables for user processes.
Data Management 2001-10-25
Why does -stringByTrimmingCharactersInSet: give me an empty string result when it shouldn't? (HTML) ()
QA1202: Why -stringByTrimmingCharactersInSet: sometimes returns an empty string result in Mac OS X 10.2.x when it shouldn't.
Data Management 2002-10-15
Detecting specific ROM-in-RAM Mac (HTML) ()
Deprecated - HW49: Identifying a Mac by name ("iMac"), and better alternatives for determining specific features ("has Firewire").
Design Guidelines 1999-10-05
Is QuickTime thread-safe? (HTML)
QA1088: Discusses thread-safety and reentrancy of the QuickTime library on both Mac & Windows.
Design Guidelines 2001-11-01
Background-only apps with NSStatusItems become active in 10.1 on NSStatusItem clicks (HTML)
QA1081: Preventing background-only apps from activating when their NSStatusItem(s) are clicked in Mac OS X 10.1.
Events & Other Input 2001-10-30
NSTimers and Rendering Loops (HTML)
QA1385: Using Cocoa timers (NSTimer) to drive a rendering loop
Events & Other Input 2004-10-04
Power Management; Policy Maker vs. Power Controller (HTML) ()
QA1121: Describes the differences between a Power Management Policy Maker and a Power Management Power Controller.
Events & Other Input 2002-02-13
Programmatically causing restart, shutdown and/or logout (HTML) ()
QA1134: Describes how to programmatically cause restart, shutdown, sleep or logout.
Events & Other Input 2003-02-10
Why aren't my tracking rects working? (HTML)
QA1355: Describes a common mistake in setting up cursor-tracking rectangles.
Events & Other Input 2004-12-02
Avoiding the -42 error with DiscRecording (HTML)
QA1292: Explains how to workaround the -42 error when using the DiscRecording API.
File Management 2004-05-25
Developing for VFS (HTML) ()
QA1242: Describes Apple's position on developing external file systems (VFS plug-ins) for Mac OS X.
File Management 2003-03-26
FSSetCatalogInfo versus UID and GID (HTML) ()
QA1251: Describes why FSSetCatalogInfo does not set the UID and GID of the file, and provides a work around.
File Management 2003-03-26
Sorting Like the Finder (HTML)
QA1159: Shows how to sort strings like the Finder's list view.
File Management 2004-10-27
Third party VFS can't unmount on Mac OS X 10.3 (HTML)
QA1308: Describes changes in unmounting behavior for VFS plug-ins under Mac OS X 10.3 "Panther."
File Management 2003-10-23
CGBitmapContextCreate Supported Color Spaces (HTML)
QA1037: Lists the color space and alpha info combinations currently supported by CGBitmapContextCreate.
Games 2004-09-09
How can I programmatically determine the DPI of the current video mode? (HTML) ()
QA1217: Describes how to compute the DPI for a given display in a given mode using Core Graphics.
Games 2002-12-02
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) ()
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Games 2002-12-04
NSTimers and Rendering Loops (HTML)
QA1385: Using Cocoa timers (NSTimer) to drive a rendering loop
Games 2004-10-04
OpenGL Sample Code (HTML)
QA1166: Describes new naming convention for OpenGL sample code
Games 2004-12-01
Setting environment variables for user processes (HTML)
QA1067: Tells how to set environment variables for user processes.
Games 2001-10-25
CGBitmapContextCreate Supported Color Spaces (HTML)
QA1037: Lists the color space and alpha info combinations currently supported by CGBitmapContextCreate.
Graphics & Imaging 2004-09-09
CGContext Bounds (HTML)
QA1048: Explains how to determine the bounds of a CGContext.
Graphics & Imaging 2001-07-02
CGContextAddLineToPoint, CGContextAddCurveToPoint, et. al. (HTML)
QA1049: Explains why the CGContextAddXYZ APIs don't draw anything immediately.
Graphics & Imaging 2001-07-02
CGContextClosePath (HTML)
QA1046: Explains when you should call CGContextClosePath.
Graphics & Imaging 2001-10-02
CGImageRef contents are immutable (HTML) ()
QA1276: Explains that CGImageRef contents are considered immutable once created.
Graphics & Imaging 2003-07-17
Debugging Graphics with QuartzDebug (HTML) ()
QA1236: Explains how to use QuartzDebug to debug graphics issues.
Graphics & Imaging 2003-02-25
Drawing a Path Multiple Times (HTML)
QA1047: Explains that path drawing operations consume the path.
Graphics & Imaging 2001-07-02
Finding an NSView's current magnification. (HTML)
QA1346: How to discover the current magnification (zoom level) of any NSView.
Graphics & Imaging 2004-12-13
How can I programmatically determine the DPI of the current video mode? (HTML) ()
QA1217: Describes how to compute the DPI for a given display in a given mode using Core Graphics.
Graphics & Imaging 2002-12-02
How do I determine how much VRAM is available on my video card? (HTML)
QA1168: Using Core Graphics and IOKit to find the physical size of VRAM on installed hardware.
Graphics & Imaging 2004-10-11
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) ()
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Graphics & Imaging 2002-12-04
How to measure CG text (HTML)
QA1051: Explains how to measure Core Graphics text.
Graphics & Imaging 2001-07-02
Is ColorSync thread safe? (HTML) ()
QA1261: Discusses ColorSync thread-safety issues.
Graphics & Imaging 2003-04-17
NSOpenGLView redraw problems after a window is closed and re-opened. (HTML)
QA1353: Workaround for NSOpenGLView failure to draw after its window is closed and re-opened.
Graphics & Imaging 2004-12-03
NSTimers and Rendering Loops (HTML)
QA1385: Using Cocoa timers (NSTimer) to drive a rendering loop
Graphics & Imaging 2004-10-04
OpenGL Sample Code (HTML)
QA1166: Describes new naming convention for OpenGL sample code
Graphics & Imaging 2004-12-01
Quartz 2D Interpolation (HTML) ()
QA1186: Explains how to control Quartz 2D's image interpolation.
Graphics & Imaging 2002-10-29
Quartz 2D Thread Safety (HTML) ()
QA1238: Explains the thread-safety issues for the Quartz 2D API.
Graphics & Imaging 2003-02-25
Saving the current Core Graphics Path (HTML)
QA1056: Explains that the Core Graphics save and restore GState APIs do not affect the path.
Graphics & Imaging 2001-10-02
Setting the ColorSync profile for a NSBitmapImageRep object (HTML)
QA1369: Setting the ColorSync profile for a NSBitmapImageRep object
Graphics & Imaging 2004-09-08
Setting the preferred CMM programatically? (HTML)
QA1086: Uses the NCMConcatProfileSet structure to specify the CMM to be used to make the CMWorldRef with the NCWConcatColorWorld function.
Graphics & Imaging 2001-10-24
Shearing a Coordinate Space with NSAffineTransform (HTML) ()
QA1332: Describes a simple way to shear coordinate spaces by adding a few methods to the NSAffineTransform class.
Graphics & Imaging 2004-01-29
Turning Off Core Graphics Clipping (HTML)
QA1050: Explains how to clear the clipping path for a CGContext.
Graphics & Imaging 2001-07-02
Unexpected CG state changes (HTML)
QA1045: Explains why the Core Graphics drawing state sometimes changes for no apparent reason.
Graphics & Imaging 2001-07-02
Using Interface Builder's NSOpenGLView or Custom View objects for an OpenGL application (HTML)
QA1167: Describes usage cases for both NSOpenGLViews and Custom Views for Cocoa OpenGL applications
Graphics & Imaging 2004-10-28
BOM characters in 'utxt' clipboard flavor (HTML) ()
QA1221: Explains the use of the BOM character in 'utxt' scrap data
Interapplication Communication 2003-01-20
How to add other pasteboard types to an HFS Promise drag in Cocoa (HTML)
QA1300: Explains how to add other pasteboard types to an HFS Promise drag in Cocoa.
Interapplication Communication 2003-09-15
How to set a custom drag image when doing an HFS Promise drag in Cocoa (HTML)
QA1200: Explains how to set a custom drag image when doing an HFS Promise drag in Cocoa.
Interapplication Communication 2003-09-15
Re-enabling dragging from NSTableView to other applications (HTML) ()
QA1220: Explains how to re-enable drag-and-drop from NSTableViews to other applications
Interapplication Communication 2002-12-02
Sending an Email (HTML)
QA1084: Shows how to create an email in the user's prefered email application.
Interapplication Communication 2004-11-05
Converting to Precomposed Unicode (HTML) ()
QA1235: Describes how to convert a string to precomposed Unicode.
Internationalization 2003-02-07
Getting a Packet Trace (HTML) ()
QA1176: Lists tools available for looking at the network packets on the wire.
Internet & Web 2004-07-13
Sending an Email (HTML)
QA1084: Shows how to create an email in the user's prefered email application.
Internet & Web 2004-11-05
Comparing selectors in Cocoa-Java code (HTML)
QA1069: Explains why Objective-C and Java selectors appear to be the same name but equality tests fail.
Java 2001-08-31
Allocate and Disk Full Error (HTML) ()
FL12: Discusses a problem with AFP volumes displaying incorrect free space, and returning disk full errors.
Networking 1999-07-21
Changing the TCP Window Size (HTML)
NW47: Describes how to change the TCP window size in Open Transport.
Networking 1997-03-14
Discovering all advertised Rendezvous service types (HTML)
QA1337: Explains how to discover all Rendezvous service types being advertised on the local network.
Networking 2004-06-01
Don't forget to cancel your Rendezvous resolve (HTML)
QA1297: Explains why it's important to cancel a Rendezvous resolve operation.
Networking 2003-10-15
Downloading through a proxy server in Mac OS X (HTML)
QA1296: Explains when downloading through a proxy server will work, and when it will fail.
Networking 2003-10-29
Getting a Packet Trace (HTML) ()
QA1176: Lists tools available for looking at the network packets on the wire.
Networking 2004-07-13
PPPoE Server for Testing (HTML) ()
QA1252: Describes how to configure Mac OS X as a PPPoE server for testing purposes.
Networking 2003-04-11
Rendezvous and wake from sleep (HTML)
QA1290: Explains why applications that use Rendezvous should stay registered and continue browsing on sleep.
Networking 2003-09-18
Rendezvous enforces the service type format in Panther (HTML)
QA1198: Explains why registering a Rendezvous service might fail on Panther.
Networking 2004-03-23
Rendezvous enforces the TXT record format in Panther (HTML)
QA1306: Explains how mDNSResponder enforces the proper TXT record format in Panther.
Networking 2004-07-14
The Rendezvous Name is not the Rendezvous name (HTML) ()
QA1228: Explains why you should use the Computer Name when advertising a Rendezvous service.
Networking 2004-03-05
Rendezvous TXT record rate limiting in Panther (HTML)
QA1293: Explains how mDNSResponder implements TXT record rate limiting in Panther.
Networking 2003-10-23
Resolves may return an IPv6 address in Panther (HTML)
QA1298: Explains why you get an IP address of 0.0.0.0 when resolving a Rendezvous service.
Networking 2005-01-10
Sending an Email (HTML)
QA1084: Shows how to create an email in the user's prefered email application.
Networking 2004-11-05
T_DATA_REQ vs M_DATA TPI Message Blocks (HTML) ()
NW42: Explains why OT passes data to a TPI module using M_DATA message blocks instead of M_PROTO+T_DATA_REQ.
Networking 1996-10-25
Updating the TXT record of a Rendezvous service (HTML)
QA1302: Explains how to update a Rendezvous TXT record while running on either Jaguar or Panther.
Networking 2004-07-14
Variable arguments in Objective-C methods (HTML)
QA1405: How to implement methods which take a variable number of arguments.
Objective-C Language 2005-01-13
Disabling a Processor on a Multiprocessor System (HTML) ()
QA1141: Describes how to disable a processor on a multiprocessor system for testing purposes.
Performance 2002-05-22
How do I tell if a particular display is being hardware accelerated by Quartz Extreme? (HTML) ()
QA1218: Describes how to use CGDisplayUsesOpenGLAcceleration to see if a display is accelerated or not.
Performance 2002-12-04
Quartz 2D Thread Safety (HTML) ()
QA1238: Explains the thread-safety issues for the Quartz 2D API.
Performance 2003-02-25
Setting environment variables for user processes (HTML)
QA1067: Tells how to set environment variables for user processes.
Porting 2001-10-25
CGContext Bounds (HTML)
QA1048: Explains how to determine the bounds of a CGContext.
Printing 2001-07-02
CGContextAddLineToPoint, CGContextAddCurveToPoint, et. al. (HTML)
QA1049: Explains why the CGContextAddXYZ APIs don't draw anything immediately.
Printing 2001-07-02
CGContextClosePath (HTML)
QA1046: Explains when you should call CGContextClosePath.
Printing 2001-10-02
Drawing a Path Multiple Times (HTML)
QA1047: Explains that path drawing operations consume the path.
Printing 2001-07-02
How to measure CG text (HTML)
QA1051: Explains how to measure Core Graphics text.
Printing 2001-07-02
Quartz 2D Interpolation (HTML) ()
QA1186: Explains how to control Quartz 2D's image interpolation.
Printing 2002-10-29
Quartz 2D Thread Safety (HTML) ()
QA1238: Explains the thread-safety issues for the Quartz 2D API.
Printing 2003-02-25
Saving the current Core Graphics Path (HTML)
QA1056: Explains that the Core Graphics save and restore GState APIs do not affect the path.
Printing 2001-10-02
SCSIAction and IOSCSIUserClient on Mac OS X 10.2 (HTML) ()
QA1201: Describes migrating to a new API for SCSI Parallel devices starting with Mac OS X 10.2.
Printing 2002-09-13
Turning Off Core Graphics Clipping (HTML)
QA1050: Explains how to clear the clipping path for a CGContext.
Printing 2001-07-02
Unexpected CG state changes (HTML)
QA1045: Explains why the Core Graphics drawing state sometimes changes for no apparent reason.
Printing 2001-07-02
Determining user login/logout status (HTML)
QA1133: Tells how to determinine if a user is logged in, and how to get login/logout notification
Process Management 2002-04-08
Is QuickTime thread-safe? (HTML)
QA1088: Discusses thread-safety and reentrancy of the QuickTime library on both Mac & Windows.
Process Management 2001-11-01
Programmatically causing restart, shutdown and/or logout (HTML) ()
QA1134: Describes how to programmatically cause restart, shutdown, sleep or logout.
Process Management 2003-02-10
Graphics Exporters - Creating 16-bit-per-channel image files (HTML)
QA1354: Discusses how to use QuickTime Graphics Exporters to create 16-bit-per-channel image files.
QuickTime 2004-06-03
Movies - Saving movie playback hints (HTML)
QA1366: Explains how to save and load media play hints from Movie files.
QuickTime 2004-09-14
Determining user login/logout status (HTML)
QA1133: Tells how to determinine if a user is logged in, and how to get login/logout notification
Resource Management 2002-04-08
Preventing sleep (HTML)
QA1160: Explains how your application can prevent the system from sleeping.
Resource Management 2004-10-22
Programmatically causing restart, shutdown and/or logout (HTML) ()
QA1134: Describes how to programmatically cause restart, shutdown, sleep or logout.
Resource Management 2003-02-10
Registering for sleep notifications (HTML)
QA1340: Explains how register for sleep notifcations on Mac OS X.
Resource Management 2004-10-25
Timely Issues - 1904 (HTML) ()
OPS23: Explains why the beginning of the year 1904 was chosen for epoch of the Time global variable.
Resource Management 1999-05-17
Detecting specific ROM-in-RAM Mac (HTML) ()
Deprecated - HW49: Identifying a Mac by name ("iMac"), and better alternatives for determining specific features ("has Firewire").
Runtime Architecture 1999-10-05